import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("idx_hot", ["hot"], {})
@Entity("rrz_search_keywords", { schema: "rrzcms" })
export class RrzSearchKeywords {
  @PrimaryGeneratedColumn({
    type: "bigint",
    name: "id",
    comment: "表ID",
    unsigned: true,
  })
  id: string;

  @Column("text", { name: "keywords", nullable: true, comment: "关键词" })
  keywords: string | null;

  @Column("varchar", {
    name: "type",
    nullable: true,
    comment: "搜索类型",
    length: 50,
    default: () => "'article'",
  })
  type: string | null;

  @Column("varchar", {
    name: "ip",
    nullable: true,
    comment: "搜索客户端的ip地址",
    length: 100,
  })
  ip: string | null;

  @Column("int", {
    name: "hot",
    nullable: true,
    comment: "关键词搜索量",
    unsigned: true,
    default: () => "'0'",
  })
  hot: number | null;

  @Column("int", {
    name: "add_time",
    nullable: true,
    comment: "搜索时间",
    unsigned: true,
  })
  addTime: number | null;
}
